package com.example.javaairportflightanalysis.controller;

import com.example.javaairportflightanalysis.common.ApiRestResponse;
import com.example.javaairportflightanalysis.service.BaseBllsService;
import com.github.pagehelper.PageInfo;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

@RestController
@RequestMapping("/DfmeBase")
public class DfmeBllsController {

    @Resource
    BaseBllsService baseBllsService;

    @GetMapping("searchLuggage")
    public ApiRestResponse searchLuggage(String fide, String ddtm, String code, Integer pageNum, Integer pageSize) throws ParseException {
        PageInfo luggage =baseBllsService.searchLuggage(fide, ddtm, code, pageNum, pageSize);
        return ApiRestResponse.success(luggage);
    }
    @GetMapping("/findLuggage")
    public ApiRestResponse getLuggage(@RequestParam Integer pageNum, @RequestParam Integer pageSize) throws ParseException {
        PageInfo luggage = baseBllsService.getLuggage(pageNum, pageSize);
        return ApiRestResponse.success(luggage);
    }
}
